package com.myhome.feign;

import com.myhome.config.feign.OAuth2FeignConfig;
import com.myhome.dto.UserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @Author QYiXin
 * @Date 2021 10 19 16 16
 **/
@FeignClient(value = "member-service",contextId = "UserFeign",configuration = OAuth2FeignConfig.class, path = "/users")
public interface UserFeign {
    @GetMapping("/basic/user")
    List<UserDto> getBasicUsers(@RequestParam("ids") List<Long> ids);

    @GetMapping("/basic/users")
    Map<Long, UserDto> getMapUserDto(@RequestParam(value = "ids"
            , required = false) List<Long> ids, @RequestParam(value = "username"
            , required = false) String userName, @RequestParam(value = "mobile"
            , required = false) String mobile);
}
